package hafnium.bukkit.pail.pipe.logging;

import org.bukkit.plugin.Plugin;

public class PPLogger {
	private final Plugin plugin;
	private int messages = 0;

	/**
	 * Constructs a logger for the specified plugin.
	 * 
	 * @param pailPlugin
	 */
	public PPLogger(Plugin pailPlugin) {
		this.plugin = pailPlugin;
	}

	/**
	 * Logs a message to the console.
	 * 
	 * @param message
	 */
	public void log(String message) {
		String idString = "[" + ((messages == 0) ? (plugin.getDescription().getFullName()) : plugin.getDescription().getName()) + "]";
		System.out.println(idString + " " + message);
		messages++;
	}
}
